package net.sf.rose.jdbc;

public class ConstantCode {

	/** Session中存的用户信息Key */
	public static String SESSION_USER = "sessionUser";

	/** Session中存的用户信息Key */
	public static String SESSION_TOKEN = "sessionToken";

	/** 一对一 */
	public static int ONE_TO_ONE = 1;
	/** 一对多列表 */
	public static int ONE_TO_MANY_LIST = 2;
	/** 一对多键值对 */
	public static int ONE_TO_MANY_MAP = 3;

	/***********************************************************************
	 * Java的常量
	 **********************************************************************/
	public static String JAVA_TYPE_TIMESTAMP = "java.sql.Timestamp";
	public static String JAVA_TYPE_BYTE_ARRAY = "byte[]";
	public static String JAVA_TYPE_DATE = "java.util.Date";
	public static String JAVA_TYPE_STRING = "java.lang.String";
	public static String JAVA_TYPE_BOOLEAN = "java.lang.Boolean";
	public static String JAVA_TYPE_BOOLEAN2 = "boolean";
	public static String JAVA_TYPE_INTEGER = "java.lang.Integer";
	public static String JAVA_TYPE_INTEGER2 = "int";
	public static String JAVA_TYPE_LONG = "java.lang.Long";
	public static String JAVA_TYPE_LONG2 = "long";
	public static String JAVA_TYPE_DOUBLE = "java.lang.Double";
	public static String JAVA_TYPE_DOUBLE2 = "double";
	public static String JAVA_TYPE_BIGDECIMAL = "java.math.BigDecimal";
	public static String JAVA_TYPE_LIST = "java.util.List";
	public static String JAVA_TYPE_INPUTSTREAM = "java.io.InputStream";

	public static String DATA_TYPE_FIX_STRING = "定长文本"; // 定长文本
	public static String DATA_TYPE_VAR_STRING = "变长文本"; // STRING_VAR
	public static String DATA_TYPE_BIG_STRING = "超长文本"; // 超长文本
	public static String DATA_TYPE_BOOLEAN = "布尔类型"; // 布尔类型
	public static String DATA_TYPE_INT = "数字整型"; // 数字整型
	public static String DATA_TYPE_LONG = "数字长整型"; // 数字长整型
	public static String DATA_TYPE_DOUBLE = "数字双精度型"; // 数字双精度型
	public static String DATA_TYPE_DECIMAL = "数字高精度型"; // 数字高精度型
	public static String DATA_TYPE_DATE = "日期时间"; // 日期时间
	public static String DATA_TYPE_STREAM = "流文件"; // 流文件
	public static String DATA_TYPE_INT_LIST = "数字列表"; // 数字列表
	public static String DATA_TYPE_STRING_LIST = "文本列表"; // 文本列表

	public static String getSimpleType(String type) {
		if (type.equals(JAVA_TYPE_BOOLEAN)) {
			return JAVA_TYPE_BOOLEAN2;
		} else if (type.equals(JAVA_TYPE_INTEGER)) {
			return JAVA_TYPE_INTEGER2;
		} else if (type.equals(JAVA_TYPE_LONG)) {
			return JAVA_TYPE_LONG2;
		} else if (type.equals(JAVA_TYPE_DOUBLE)) {
			return JAVA_TYPE_DOUBLE2;
		}
		return type;
	}
}
